//
//  ClMineMenuTableViewCell.swift
//  CLEasyBBQ
//
//  Created by simon zhao on 2017/4/14.
//  Copyright © 2017年 simon zhao. All rights reserved.
//

import UIKit

protocol cellEditDelegate {
    
    func aletEdit(cell:UIButton!)
}

protocol cellDeleteDelegate {
    
    func deleteCell(btn:UIButton!)
}

class ClMineMenuTableViewCell: UITableViewCell {
    
    @IBOutlet weak var labelHeightCs: NSLayoutConstraint!
    @IBOutlet weak var numLabel: UILabel!
    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var priceLabel: UILabel!
    @IBOutlet weak var unitLabel: UILabel!
    @IBOutlet weak var coVerBtn: UIButton!
    @IBOutlet weak var deleteBtn: UIButton!
    
    var editDeleGate : cellEditDelegate!
    var deleteDelegate : cellDeleteDelegate!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        labelHeightCs.constant = self.contentView.frame.size.height
        coVerBtn.addTarget(self, action: #selector(editMenu), for:.touchUpInside)
        deleteBtn.addTarget(self, action: #selector(deleteData), for: .touchUpInside)
        
    }
    
    func editMenu(btn:UIButton!) {
        
        if editDeleGate != nil {
            
            editDeleGate.aletEdit(cell: btn)
        }
    
    }
    
    func deleteData(sender:UIButton!) {
        
    
        if deleteDelegate != nil {
            
            deleteDelegate.deleteCell(btn: sender)
        }
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
